-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
psbt: always use non witness serialization format #1842
Conversation
Pull Request Test Coverage Report for Build 2161078427
💛 - Coveralls |
This requires a new tag ( |
|
||
// BIP-0174 states: "The transaction must be in the old serialization | ||
// format (without witnesses)." | ||
err = msgTx.DeserializeNoWitness(bytes.NewReader(value)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we continue to try to decode the witness version and fall back to non-witness? Since it's possible there's old software out there encoding wit the witness version, we'd potentially break compatibility across lnd version for even btcutil versions with this change as is.
It seems the most important thing here is for us to encode using the new witness version, AFAICT. So if we just serialize w/o the witness, then things are compatible across the prior versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add the fallback. Though I don't think this change will create a compatibility issue. A PSBT packet with an unsigned TX that has a witness set cannot be serialized, the library will complain. And if you call msgTx.Serialize()
with a transaction that has no witness, the old format will be used. Therefore the change to the serialization is purely to be more explicit about it. The actual important change is that we always read the TX expecting it to be in the non-witness format.
BIP-0174 states that the transaction must be in the old serialization format (without witnesses).
5991989
to
eb2eeaf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🛰
The tag |
Fixes #1841.
BIP-0174 states that the transaction must be in the old serialization
format (without witnesses).
https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki#specification (see first entry in table).
cc @Roasbeef, @positiveblue
Fixes lightningnetwork/lnd#6386